﻿using System;
using System.Reflection;

namespace DictToObject.Helpers
{
    public class PropertyMember : IFieldLikeMember
    {
        private readonly PropertyInfo propertyInfo;

        public PropertyMember(PropertyInfo propertyInfo)
        {
            this.propertyInfo = propertyInfo;
        }

        public Type Type
        {
            get { return propertyInfo.PropertyType; }
        }

        public void SetValue(object instance, object value)
        {
            propertyInfo.SetValue(instance, value);
        }
    }
}